<template>
  <basic-container :btnFlag="true">
    <div class="card-border" style="padding-bottom: 28px;">
      <card-header :header-data="headerData"></card-header>
      <div class="step-group" style="margin: 20px;margin-bottom: 1px;">
        <el-steps :active="1" v-if="havModifyOpinion">
          <el-step title="上报报告(退回修改)" icon="el-icon-edit"></el-step>
          <el-step title="政府审定(人大退回)" icon="el-icon-upload"></el-step>
          <el-step title="党委审核" icon="el-icon-message-solid"></el-step>
          <el-step title="人大审议" icon="el-icon-picture"></el-step>
          <el-step title="抄送上级发改" icon="el-icon-upload"></el-step>
        </el-steps>
        <el-steps :active="1" v-else>
          <el-step title="上报报告(退回修改)" icon="el-icon-edit"></el-step>
          <el-step title="政府审定(人大退回)" icon="el-icon-upload"></el-step>
          <el-step title="人大审议" icon="el-icon-picture"></el-step>
          <el-step title="抄送上级发改" icon="el-icon-upload"></el-step>
        </el-steps>
      </div>
      <div style="text-align: center; margin-top: 40px;margin-bottom: 40px;">
        <el-button type="warning" @click="submitEdit()">确认退回</el-button>
        <el-button type="info" @click.stop="goBack()">关闭</el-button>
      </div>
      <el-collapse v-model="activeNames" style="margin-top:2rem;">
        <el-collapse-item name="1">
          <template slot="title">
            <div class="card-header collapse-header">
              <div class="head-title collapse-title">中期评估报告信息</div>
            </div>
          </template>
          <div class="searchDetail">
            <report-detail  @putData="putData" :reportId="$route.query.reportId"></report-detail>
          </div>
        </el-collapse-item>
      </el-collapse>
      <el-collapse v-model="activeNamessd" >
        <el-collapse-item name="1">
          <template slot="title">
            <div class="card-header collapse-header">
              <div class="head-title collapse-title">人大审议意见</div>
            </div>
          </template>
          <div class="searchDetail">
            
      <table class="bs-table">
              <tr class="bs-table_row">
                <th class="bs-table_th" style="width: 200px;">审议结果</th>
                <td colspan="3" class="bs-table_td">不同意</td>
              </tr>
              <tr class="bs-table_row">
                <th class="bs-table_th" style="width: 200px;">意见或理由</th>
                <td
                  colspan="3"
                  class="bs-table_td"
                > {{$route.query.considerOpinion}}</td>
              </tr>
            </table>
          </div>
        </el-collapse-item>
      </el-collapse>
    </div>
  </basic-container>
</template>

<script>
import { getReportDetail, reportEdit, taskZfReturn } from "@/api/pim/pim";
import { getfileinfopage } from "@/api/system";
import { getNotNull } from "@/views/util";
import reportDetail from "@/components/pim/report/detail"

export default {
  name: "reportReject",
  created() {
    this.opinion = this.$route.query.opinion;
  },
  components:{
   reportDetail
  },
  data() {
    return {
      havModifyOpinion:'',
      headerData: {
        title: "人大退回"
      },
      activeNames: ["1"],
      activeNamessd: ["1"],
      editForm: {
        fileIds: [],
        material_fileIds: []
      },
      projectForm: {
        //用于存放相关报告和相关附件
        textId: null
      },
      opinion: ""
    };
  },
  methods: {
      putData(data){
          this.havModifyOpinion=data.havModifyOpinion
      },
    reportTypeTransform(reportType, year) {
      switch (reportType) {
        case "2":
          return "中期评估报告";
          break;
        case "3":
          return "期末总结报告";
          break;
        case "1":
          return year + "年度监测分析报告";
          break;
      }
    },
    goBack() {
      this.$router.go(-1);
    },
    submitEdit() {
      this.$confirm("确认退回?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        taskZfReturn(this.$route.query.taskId).then(response => {
          if (response.data.code == "0") {
            this.$message({
              message: "退回成功！",
              type: "success"
            });
            this.$router.go(-1);
          }
        });
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.step-group {
  margin: 5rem 0;
  margin-bottom: 1px;
}

.form-item {
  color: black;
  font-size: 16px;
  font-weight: 600;
}
</style>
